<template>
	<view class="projectBox">
		<view class="navBox">
			<u-navbar title="可体验项目" :titleStyle="{fontWeight:'900'}" bgColor="#ffffff">
				<view class="u-nav-slot" slot="left"></view>
			</u-navbar>
		</view>
		<view class="projectList">
			<view class="projectItem" v-for="(item,index) in projectList" :key="index">
				<image src="../../static/images/projectBg.png" class="itemBg"></image>
				<view class="itemTop">
					<view class="topLeft">
						<view class="name">{{item.name}}</view>
						<view class="title">项目简介:</view>
					</view>
					<image :src="$cdn(item.cover)" class="project"></image>
				</view>
				<view class="itemBottom">
					{{item.intro}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getProjectList
	} from "@/api/api.js"
	export default {
		data() {
			return {
				projectList: []
			}
		},
		methods: {
			onLoadMethod() {
				this.getProjectList()
			},
			getProjectList() {
				getProjectList().then(res => {
					this.projectList = res.data
				})
			},
			onHideMethod() {
				uni.pageScrollTo({
					scrollTop: 0,
					duration: 0
				});
			},
		}
	}
</script>

<style lang="scss" scoped>
	.projectBox {
		min-height: 100vh;
		background-color: #f8f8f8;

		.navBox {
			position: relative;
			z-index: 1000;
		}

		.projectList {
			margin: 160rpx 34rpx 0rpx;
			padding-bottom: 120rpx;

			.projectItem {
				position: relative;

				.itemBg {
					position: absolute;
					width: 100%;
					height: 100%;
				}

				.itemTop {
					padding: 34rpx 40rpx 0;
					position: relative;
					z-index: 100;
					display: flex;
					justify-content: space-between;

					.topLeft {
						flex: 1;
						display: flex;
						flex-direction: column;
						justify-content: space-between;

						.name {
							font-weight: 600;
							font-size: 28rpx;
							color: #000000;
						}

						.title {
							font-size: 28rpx;
						}
					}

					.project {
						width: 192rpx;
						height: 144rpx;
					}
				}

				.itemBottom {
					position: relative;
					z-index: 100;
					margin-top: 14rpx;
					padding: 0rpx 40rpx 34rpx;
					font-size: 24rpx;
					color: #666666;
				}
			}
		}
	}
</style>